package net.qunzhi.modules.sqlserver.dao;

import cn.hutool.core.lang.Pair;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import net.qunzhi.modules.cms.vo.XiJiangVO;
import net.qunzhi.modules.cms.vo.XjWaterSummary;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface XjFlowDataDao {


    Map<String, BigDecimal> getInsFlowData(String maxTime);

    String getMaxTime(@Param("start") String start, @Param("end") String end);

    Map<String, BigDecimal> getFlowData(@Param("start") String start, @Param("end") String end);

    Map<String, Object> getDataResult(@Param("start") String start, @Param("end") String end, @Param("startNight") String startNight
            , @Param("endNight") String endNight, @Param("hour") String hour);

    List<Map<String, Object>> getTrend(@Param("start") String start, @Param("end") String end);

    List<Map<String, Object>> getNightTrend(@Param("start") String start, @Param("end") String end);

    List<Map<String, Object>> getDetail(String date);

    Map<String, Object> getInsData();


    /*-------------cpk----------------------*/

    List<XjWaterSummary> getDailyWaterSupply(@Param("startDate") String startDate, @Param("endDate") String endDate);

    List<Pair<String, Object>> getXjWaterDrawDaily(@Param("startDate") String startDate, @Param("endDate") String endDate);

   // List<Map<String, Object>> getDailyWaterInput(@Param("start") String start,@Param("end") String end);


   /* List<Map<String, Object>> getLowPressureLeakageRate(@Param("start") String start,@Param("end") String end);

    List<Map<String, Object>> getWaterAndTapWaterRate(@Param("start") String start,@Param("end") String end);
*/
    List<Pair<String, Object>> getMorningWaterOfXj(@Param("startDate") String startDate,@Param("endDate") String endDate);

    Object getCumulativeWaterOfXjSupply(@Param("startDate") String startDate);

    Object getCumulativeWaterOfXjDraw(@Param("startDate") String startDate);

    List<XiJiangVO> page(@Param("index") Integer index, @Param("limit") Integer limit, @Param("endDateTime") String endDateTime, @Param("startDateTime") String startDateTime);

    int getTotalCount(String endDateTime, String startDateTime);

}
